﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using Abp.Application.Services;
using FwProject.Restaurant.Dto;
using FwProject.Users.Dto;
using Microsoft.AspNetCore.Mvc;

namespace FwProject.Restaurant
{
    public interface IRestaurantAppService : IApplicationService
    {
        /// <summary>
        /// 添加一个餐厅
        /// </summary>
        /// <returns>The create.</returns>
        /// <param name="input">Input.</param>
        Task<Guid> Create(RestaurantInputDto input);


        /// <summary>
        /// 修改餐厅信息
        /// </summary>
        /// <returns>The create.</returns>
        /// <param name="input">Input.</param>
        Task Update(Guid id, RestaurantInputDto input);
        /// <summary>
        /// 修改餐厅店存
        /// </summary>
        /// <param name="id"></param>
        /// <param name="stock"></param>
        /// <returns></returns>
        Task EditStock(Guid id, int stock);
        /// <summary>
        /// 返回餐厅信息
        /// </summary>
        /// <returns>The by identifier async.</returns>
        /// <param name="id">Identifier.</param>
        [HttpGet]
        Task<RestaurantDto> GetByIdAsync(Guid id);
        /// <summary>
        /// 获取餐厅列表
        /// </summary>
        /// <returns>The paged list async.</returns>
        /// <param name="id">餐厅编号</param>

        [HttpGet]
        Task<IList<AppRestaurantDto>> GetPagedListAsync(string Restaurantname, DateTime? begindateTime, DateTime? enddatetime);

        Task<X.PagedList.IPagedList<RestaurantDto>> GetCollectDepositListAsync(int pageIdx, int pageSize, DateTime? beginTime, DateTime? endTime, string restaurantName);
        Task EditDeposit(Guid id, decimal deposit);

        Task<List<RestaurantDto>> GetReturnDepositListAsync();
        Task ReturnDeposit(Guid id, decimal money);

        Task<X.PagedList.IPagedList<RestaurantOutputDto>> GetAllPagedListAsync(int pageIdx, int pageSize, string factoryid, string keyword, long? DriverId, Guid? LineId);

        Task<X.PagedList.IPagedList<RestaurantOutputDto>> GetDiscontinuationPagedListAsync(int pageIdx, int pageSize, DateTime? beginTime, DateTime? endTime);

        Task<X.PagedList.IPagedList<RestaurantOutputDto>> GetNewAddPagedListAsync(int pageIdx, int pageSize, DateTime? beginTime, DateTime? endTime);

        Task<List<RestaurantOutputDto>> GetRestaurantNewAddAsync(DateTime? beginTime, DateTime? endTime);

        Task<List<RestaurantOutputDto>> GetDiscontinuationListAsync(DateTime? beginTime, DateTime? endTime);

        Task<List<RestaurantOutputDto>> GetRestaurantListAsync();

        Task<X.PagedList.IPagedList<RestaurantDto>> GetRestaurantPagedListAsync(int pageIdx, int pageSize, string restaurantName);

        Task EditRestaurantInfo(RestaurantModelDto input);

        Task EditRestaurantByFactory(Guid id, Guid FactoryInfoId);


        Task<RestaurantInputDto> GetByEnterIdAsync(Guid id);


        Task DeleteAsync(Guid id);

        /// <summary>
        /// 获取所有未分配工厂餐厅
        /// </summary>
        /// <param name="pageIdx"></param>
        /// <param name="pageSize"></param>
        /// <param name="keyword"></param>
        /// <returns></returns>
        Task<X.PagedList.IPagedList<RestaurantDto>> GetUnassignedsAsync(int pageIdx, int pageSize, string keyword);
        /// <summary>
        ///三公里用碗前10排名
        /// </summary>
        /// <returns></returns>
        List<AppTopRestaurantDto> GetTopRestaurant();

        /// <summary>
        /// 获取餐厅分布信息
        /// </summary>
        /// <returns></returns>
        Task<List<RestaurantDistributedDto>> GetRestaurantDistributedAsync(Guid? id, string keyword);

        /// <summary>
        /// 餐厅预收款信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<List<RestaurantAdvancePaymentDto>> GetRestaurantAdvancePaymentAsync(Guid? id);

        /// <summary>
        /// 餐厅店存统计（分页）
        /// </summary>
        /// <returns></returns>
        Task<X.PagedList.IPagedList<RestaurantStockDto>> GetRestaurantStockAsync(int pageIdx, int pageSize, string restaurantName, string driverId);

        /// <summary>
        /// 餐厅店存统计导出
        /// </summary>
        Task<List<RestaurantStockDto>> GetExportRestaurantStockAsync(string restaurantName, string driverId);
        ///// <summary>
        ///// 收押金导出
        ///// </summary>
        //Task<List<ExportCollectDepositDto>> GetExportCollectDepositListAsync(string restaurantName);
        ///// <summary>
        ///// 退押金导出
        ///// </summary>
        //Task<List<ExportCollectDepositDto>> GetExportReturnDepositListAsync(string restaurantName, DateTime? beginTime, DateTime? endTime);
        /// <summary>
        /// 获取餐厅配送详情
        /// </summary>
        Task<X.PagedList.IPagedList<RestaurantDistributionDetailsDto>> GetRestaurantDetailsPagedListAsync(int pageIdx, int pageSize, Guid restaurantId, DateTime? beginTime, DateTime? endTime);

        Task<List<RestaurantOutputDto>> GetRestaurantByDriverIdAsync(long driverId);


        Task<ExcelImportRetaurantSuccess> ExcelImportAsync(List<ExcelImportRetaurant> dto,Guid FactoryinfoId);
    }
}
